package com.smartstate.dataManagement.service;


import com.alibaba.excel.event.AbstractIgnoreExceptionReadListener;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smartstate.dataManagement.dto.PageDTO;
import com.smartstate.dataManagement.entity.Permission;
import com.smartstate.dataManagement.entity.Role;
import com.smartstate.dataManagement.vo.ResultCode;
import com.smartstate.dataManagement.vo.ResultVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RoleService extends ServiceBase<Role>{
    Role getRoleByName(String roleName);

    /**
     * 根据用户id查询用户的角色
     */
    Role getRoleByUserId(@Param(value = "userId") String userId);

    Role getByRoleId(String id);

    List<Role> getEnableAll();

    Page<Role> getRoleByNameAndStatus(PageDTO<Role> pageDTO);

    Boolean add(Role item);

    ResultVO<String> addRole(String roleName, String note, List<String> ids);

    ResultVO<String> updatePermById(String roleId,String roleName,String note, List<String> ids);

    ResultVO<ResultCode> delRoleByID(String id);

    Boolean delBatchRoleByID(List<String>  ids);

    List<Role> getRoleLikeName(String roleName);

    ResultVO<ResultCode> updateByRoleID(Role role);

}
